#ifndef _ADAPTER_H_
#define _ADAPTER_H_

#include <iostream>
#include "duck.h"
#include "turkey.h"

// 适配器
// 多继承的时候需要指明每一个基类的继承类型
class Adapter : public Duck, public Turkey
{
public:
    // 嘎嘎叫
    // virtual void Quack() = 0;
    // // 咕咕叫
    // virtual void Gobble() = 0;
    // virtual void Fly() = 0;

protected:
};

class TurkeyAdapter : public Adapter
{
public:
    void Gobble();
    void Fly();
    void Quack();

    TurkeyAdapter(Duck *duck)
        : _duck(duck)
    {
    }

private:
    Duck *_duck;
};

class DuckAdapter : public Adapter
{
public:
    void Gobble();
    void Quack();
    void Fly();

    DuckAdapter(Turkey *turkey)
        : _turkey(turkey)
    {
    }

private:
    Turkey *_turkey;
};

#endif